<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateYStatisticsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if(!Schema::hasTable('y_statistics')) {
            Schema::create('y_statistics', function (Blueprint $table) {
                $table->increments('statistic_id');
                $table->integer('statistic_newuser_perday')->default(0)->comment('每日用户增长');
                $table->integer('statistic_newpic_perday')->default(0)->comment('每日图片增长');
                $table->integer('statistic_total_user_num')->default(0)->comment('用户总数');
                $table->integer('statistic_total_user_male_num')->default(0)->comment('男性用户总数');
                $table->integer('statistic_total_user_female_num')->default(0)->comment('女性用户总数');
                $table->integer('statistic_total_pic_num')->default(0)->comment('图片总数');
                $table->timestamps();
                //索引
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('y_statistics');
    }
}
